toSet

abstract fun toSet(): Set<Any>

Converts this set to a Set.

The type mapping rules for the set elements are the following:


| JavaScript         | Java           |
|--------------------|----------------|
| Number             | Double         |
| String             | String         |
| Boolean            | Boolean        |
| null and undefined | null           |
| Node               | Node, JsObject |
| ArrayBuffer        | byte[]         |
| Array              | List<?>        |
| Set                | Set<?>         |
| Map                | Map<?,?>       |
| Object             | JsObject       |
| Proxy Object       | Object         |

Proxy objects are mapped to the corresponding injected Java object.

Return

a set containing the converted elements from this set

Throws

when the JavaScript object is already disposed or invalid


abstract fun <T> toSet(type: Class<T>): Set<T>

Converts this set to a Set.

The type mapping rules for the set elements are the following:


| JavaScript         | Java           |
|--------------------|----------------|
| Number             | Double         |
| String             | String         |
| Boolean            | Boolean        |
| null and undefined | null           |
| Node               | Node, JsObject |
| ArrayBuffer        | byte[]         |
| Array              | List<?>        |
| Set                | Set<?>         |
| Map                | Map<?,?>       |
| Object             | JsObject       |
| Proxy Object       | Object         |

Proxy objects are mapped to the corresponding injected Java object.

All elements in this set must be of a type convertible to the type T according to the mapping rules.

Return

a set containing the converted elements from this set

Parameters

type

the Java type to convert elements in this set to, according to the mapping rules

<T>

the type of the converted elements

Throws

when the JavaScript object is already disposed or invalid